<%@ page contentType="text/html; charset=UTF-8" language="java" %>
<%@ include file="/parameter.jsp" %>
<%@page isELIgnored="false"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<TITLE>论坛</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<Meta http-equiv="Pragma" Content="No-cach">
<link href="style/style.css" rel="stylesheet" type="text/css" />
<script language="javascript">
function loginsubmit(){
	return form1.submit();
}
function SearchSubmit(){
	if(document.getElementById('keywords').value == ""){
		alert("请输入搜索关键字！");
		return false;
	}else{
		return document.forms["form3"].submit();
	}
}
</script>
</HEAD>
<body>
	<jsp:include page="inc/header.jsp" />
		<header class="entry-header">
			<h1 class="entry-title">
				<span>${SortList.boardname}<div id="searchbar">
				<form name="form3" method="post" action="commonAction.do?method=SearchTopic">
					<input type="text" id="keywords" name="keywords" title="搜索"><button onClick="search();">搜索</button>
				</form>
				</div></span>
			</h1>
		</header>
		
		<div id="maindiv">
			<div id="nav">
			<c:choose>
				<c:when test="${sessionScope.user == null}">
					<div>
						<form name="form1" method="post" action="commonAction.do?method=UserLogin">
						账号：<input type="text" name="username"> 密码：<input type="password" name="password"> 
						<button onClick="loginsubmit();">登陆</button> <a href="commonAction.do?method=toRegister">注册新账号</a>
						</form>
					</div>
				</c:when>
				<c:otherwise>
					<div>
					&nbsp;&nbsp;<c:choose><c:when test="${sessionScope.user.nickname != ''}">${sessionScope.user.nickname}</c:when><c:otherwise>${sessionScope.user.username}</c:otherwise></c:choose>&nbsp;你好！<a
							href="commonAction.do?method=Logout">注销</a>&nbsp;|&nbsp;<a
							href="commonAction.do?method=EditUserInfo&uid=${sessionScope.user.id}">修改个人信息</a>&nbsp;|&nbsp;<a
							href="commonAction.do?method=EditUserPwd&uid=${sessionScope.user.id}">修改密码</a>
					</div>
				</c:otherwise>
			</c:choose>
				<a href="./" title="首页">首页</a>
				<span>&gt;</span>
				${SortList.boardname}
			</div>
<div id="board">
				<div class="bm">
					<div class="bm_h">
						<h2>
						  <a href="commonAction.do?method=SortInfo&sortid=${SortList.id}">${SortList.boardname}</a>
						</h2>
					</div>
					<div class="bm_b">
						<table cellspacing="0" cellpadding="0" class="sub_bm_tb">
        					<c:forEach items="${SortList.selfboard}" var="sortList">
							<tr class="bm_row">
								<td class="sub_bm_icon"><img src="images/forum_new.gif" /></td>
								<td>
									<h2><a href="commonAction.do?method=SortTopicInfo&superid=${sortList.supersetid}&sortid=${sortList.id}&param=1">${sortList.boardname}</a></h2>
									<p class="sub_desc">${sortList.summary}</p>
                                    版主：<a href="commonAction.do?method=ViewUserInfo&uid=${sortList.boarduser.id}">${sortList.boarduser.nickname}</a>
								</td>
								<td class="sub_bm_info">${sortList.posttaday}/${sortList.topiccount}/${sortList.postsize}</td>
								<td class="sub_bm_by">
									<div>
										<a href="commonAction.do?method=TopicResponsInfo&topid=${sortList.postlatest.id}">${sortList.postlatest.title}</a>
										<cite>
											<span><fmt:formatDate value="${sortList.postlatest.date}" type="both"/><span><br />
											<a href="commonAction.do?method=ViewUserInfo&uid=${sortList.postlatest.postuser.id}">${sortList.postlatest.postuser.nickname}</a>
										</cite>
									</div>
								</td>
							</tr>
							</c:forEach>
						</table>
					</div>
				</div>
				

			</div>
		</div>
	<jsp:include page="inc/footer.jsp" />
</body>
</HTML>